import {defineStore} from 'pinia'
import {ref} from "vue";
import { TOKEN_KEY } from "@/constants";
import Cookies from "js-cookie";

export const useUserStore = defineStore('hm-user', () => {
    const token = ref('')
    const setToken = (val: string) => {
        token.value = val;
        Cookies.set(TOKEN_KEY, val);
    }

    return {token, setToken}
})
